{include file='common/head'}
<body>
<div class="x-body">
    <!--<table class="layui-table" style="width: 97px">
        <thead>
        <tr>
            <td>用户信息:</td>

        </tr>
        </thead>
    </table>-->
    <form class="layui-form" action="">
    <table class="layui-table">
        <tr>
            <td>用户ID:</td>
            <td><?php echo $res['0']['uid'];?></td>
            <td>手机号:</td>
            <td><?php echo $res['0']['phone'];?></td>
            <td>姓名:</td>
            <td><?php echo $res['0']['uname'];?></td>
        </tr>
    </table>
    <table class="layui-table">
        <tr>
            <td>认证ID:</td>
            <td><?php echo $res['0']['rid'];?></td>
            <td>套餐:</td>
            <td><?php echo $res['0']['phase_time'];?>个月</td>
			 <td>支付费用:</td>
            <td><?php echo $res['0']['price'];?>元</td>
            <td>开始时间:</td>
            <td><?php echo $res['0']['starttime'];?></td>
            <td >结束时间:</td>
            <td><?php echo $res['0']['stoptime'];?></td>
        </tr>
	 <table class="layui-table" lay-even=""  style="width: 97px">
        <tr>
            <td width="40px">身份证正面</td>
        </tr>
        </table>
    </table>
    <div style="padding-left: 120px;margin-top: -40px;">
            <td><img src="/upload/real/<?php echo $res['0']['front_img']?>" width="400px" ></td>
    </div>
	 <table class="layui-table" lay-even=""  style="width: 97px">
        <tr>
            <td width="40px">身份证反面:</td>
        </tr>
        </table>
    </table>
    <div style="padding-left: 120px;margin-top: -40px;">
            <td><img src="/upload/real/<?php echo $res['0']['reverse_img']?>" width="400px" ></td>
    </div> 
    </form>
</div>

<div class="x-body">

</div>
<script>
    layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;
        //执行一个laydate实例
        form.on('switch(switchSuodoing)', function(data){
            var id = data.value;
            //alert(111);
            $.ajax({
                url: "{:url('index/xinxi/suodingflg')}",
                type: "post",
                dataType: "JSON",
                data: {mid: id},
                success: function (res) {
                    if (res ==1) {
                        layer.msg('操作成功！');
                        //alert(11);
                        //location.reload();
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        /*setTimeout(function () {
                            location.reload();
                        }, 1000);*/
                        return false;
                    }
                }
            });
        });


        form.on('switch(switchTest)', function(data){
            var id = data.value;
            //var faxian=data.value.slice(2,3);
            //alert(faxian);
            $.ajax({
                url: "{:url('index/xinxi/faxianflg')}",
                type: "post",
                dataType: "JSON",
                data: {mid: id},
                success: function (res) {
                    if (res ==1) {
                        layer.msg('操作成功！');
                        //alert(11);
                        //location.reload();
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        /*setTimeout(function () {
                            location.reload();
                        }, 1000);*/
                        return false;
                    }
                }
            });
        });


    });

    /*用户-停用*/
    function member_stop(obj,id){
        layer.confirm('确认要修改吗？',function(index){
             if($(obj).attr('title')=='已推荐'){
                 //var mid=id;
                 //alert(mid);
                    //发异步把用户状态进行更改
                    $(obj).attr('title','未推荐')
                    $(obj).find('i').html('&#xe601;');

                    $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('未推荐');
                    layer.msg('已取消推荐!',{icon: 5,time:1000});

                }else{
                 var mid=id;
                 $.ajax({
                     type: "post",
                     async:false,
                     url: "{:url('index/xinxi/faxianflg')}",
                     data: {'id':mid},
                     dataType:'json',
                     success:function (res) {
                         //console.log(res)
                         if(res==1){
                             $(obj).attr('title','已推荐')
                             alert(22);
                             $(obj).find('i').html('&#xe62f;');

                             $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已推荐');
                             layer.msg('已推荐!',{icon: 1,time:1000});
                         };
                     }
                 });
                 //var mid=id;
                 //alert(mid);

                }
        });
    }


    /*用户-删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }



    function delAll (argument) {

        var data = tableCheck.getData();

        layer.confirm('确认要删除吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
</script>

</body>

</html>